class Solution {
public:
    bool canPermutePalindrome(string s) {
        int cnt = 0;
        unordered_map<char, int> hash;

        for(int i = 0; i < s.size(); ++i)
        {
            hash[s[i]]++;
        }

        for(auto& e : hash)
        {
            if((e.second & 1) == 1)
                cnt++;
        }
        return cnt == 1 || cnt == 0;
    }
};
